package com.black.platform.role.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.black.platform.permission.po.Permission;
import com.black.platform.role.po.RolePermission;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RolePermissionMapper extends BaseMapper<RolePermission> {

    @Select(
     "<script>"+
        "SELECT p.id,p.permission_type permissionType from role_permission rp left join permission p on rp.permission_id = p.id "+
        "where rp.role_id =#{ roleId }"+
      "</script>"
    )
    List<Permission> getPermissionByRoleId(@Param("roleId") Long roleId);
}
